package com.senney.service.impl;

import com.senney.bean.UserAddress;
import com.senney.service.OrderService;
import com.senney.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @DubboReference
    UserService userService;

    @Override
    public List<UserAddress> initOrder(String userId) {
        System.out.println("用户ID：" + userId);
        List<UserAddress> addressList = userService.getUserAddressList(userId);
        addressList.stream().map(x -> x.getUserAddress()).forEach(System.out::println);
        return addressList;
    }
}
